<?php // $this->load->view('layouts/_flash'); 
	$frm_att = array('class'=>'admin-form');

	if($user_data != FALSE)
	{
		foreach($user_data as $data)
		{
			$given_id_value = set_value('given_id') == FALSE ? $data->given_id : set_value('given_id');
			$ln_value = set_value('last_name') == FALSE ? $data->last_name : set_value('last_name');
			$fn_value = set_value('first_name') == FALSE ? $data->first_name : set_value('first_name');
			$mn_value = set_value('middle_name') == FALSE ? $data->middle_name : set_value('middle_name');
			$bd_value = set_value('birthdate') == FALSE ? $data->birthdate : set_value('birthdate');
			$e_value = set_value('email') == FALSE ? $data->email : set_value('email');
			$g_value = set_value('gender') == FALSE ? $data->gender : set_value('gender');
			$cs_value = set_value('civil_status') == FALSE ? $data->civil_status : set_value('civil_status');
			$f_value = set_value('father_name') == FALSE ? $data->father_name : set_value('father_name');
			$m_value = set_value('mother_name') == FALSE ? $data->mother_name : set_value('mother_name');
			$s_value = set_value('spouse_name') == FALSE ? $data->spouse_name : set_value('spouse_name');
			$cn_value = set_value('children_num') == FALSE ? $data->children_num : set_value('children_num');
			
			$given_id_att = array('name' => 'given_id', 'id' => 'given_id', 'value' => $given_id_value);
			$ln_att = array('name' => 'last_name', 'id' => 'last_name', 'value' => $ln_value);
			$fn_att = array('name' => 'first_name', 'id' => 'first_name', 'value' => $fn_value);
			$mn_att = array('name' => 'middle_name', 'id' => 'middle_name', 'value' => $mn_value);
			$bd_att = array('name' => 'birthdate', 'id' => 'birthdate', 'class' => 'birthdate', 'value' => $bd_value);
			$e_att = array('name' => 'email', 'id' => 'email', 'value' => $e_value);
			$g_att = array('id' => 'gender');
			$cs_att = array('name' => 'civil_status', 'id' => 'civil_status', 'value' => $cs_value);
			$f_att = array('name' => 'father_name', 'id' => 'father_name', 'value' => $f_value);
			$m_att = array('name' => 'mother_name', 'id' => 'mother_name', 'value' => $m_value);
			$s_att = array('name' => 'spouse_name', 'id' => 'spouse_name', 'value' => $s_value);
			$cn_att = array('name' => 'children_num', 'id' => 'children_num', 'value' => $cn_value);
		}
	}
?>

<div style="float: left;">
<div class="ui-corner-top side_menu" style="width: 700px;">View Profile</div>
<div style="border:1px  solid #286bcc;">
<div>&nbsp;</div>
	<div>
		<?if(isset($system_message))echo $system_message;
		echo validation_errors('<div class="error">', '</div>');
		?>
		<?if(!empty($user_data)): ?>
			<?echo form_open('hrd/profile',$frm_att);?>
			<div class="input-block">
				<?
					echo form_label('Given ID','Given ID');
					echo form_input($given_id_att);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('Last Name','Last Name');
					echo form_input($ln_att);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('First Name','First Name');
					echo form_input($fn_att);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('Middle Name','Middle Name');
					echo form_input($mn_att);
				?>
			</div>
			<div class="input-block">
				<? echo form_label('Birthdate','Birthdate'); ?>
				<? echo form_input($bd_att); ?>
			</div>
			<div class="input-block">
				<?
					echo form_label('Email','Email');
					echo form_input($e_att);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('Gender','Gender');
					$g_options = array('M'=>'Male','F'=>'Female');
					echo form_dropdown('gender', $g_options, $g_value);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('Civil Status','Civil Status');
					$cs_options = array('single'=>'Single','married'=>'Married','widowed'=>'Widowed','widower'=>'Widower');
					echo form_dropdown('civil_status',$cs_options, $cs_value);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('Father Name','Father Name');
					echo form_input($f_att);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('Mother Name','Mother Name');
					echo form_input($m_att);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('Spouse Name','Spouse Name');
					echo form_input($s_att);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_label('No. of Children','No. of Children');
					echo form_input($cn_att);
				?>
			</div>
			<div class="input-block">
				<?
					echo form_submit('update_profile','Update profile');
					echo form_close();
				?>
			</div>
		<?else:?>
			<div class="notice">No employee record yet. Inform your admin.</div>
		<?endif;?>
	</div>
</div>
<div>&nbsp;</div>
</div>